---
title: 'BaseAI CLI'
description: "CLI reference of BaseAI CLI."
tags:
    - baseai
    - cli
    - langbase
section: 'Getting Started'
published: 2024-09-24
modified: 2024-09-24
---

# BaseAI CLI

The BaseAI CLI allows you to develop, build, and deploy BaseAI primitives from the command line to Langbase. This document provides an overview of the commands available in the CLI.

---

## Basic Usage

In your project root directory, install `baseai` using the following command:

For `npm`
```shell
npx baseai@latest init
```

For other package managers:
```shell
# pnpm
pnpm dlx baseai@latest init

# yarn
yarn dlx baseai@latest init

# bun
bunx --bun baseai@latest init
```

---

## Commands

The following commands are available in the CLI:

| Command | Description |
| --- | --- |
| `init` | Initialize, install, and setup BaseAI |
| `dev` | Starts the local server of BaseAI in development mode |
| `pipe` | Starts the process of creating a pipe in your application |
| `memory` | Starts the process of creating a memory in your application |
| `tool` | Starts the process of creating a tool in your application |
| `add` | Adds a pipe present on Langbase to your project |
| `auth` | Starts the authentication process of BaseAI with Langbase |
| `build` | Builds `pipes`, `memory` and `tools` for deployment to Langbase |
| `deploy` | Deploys your BaseAI application to Langbase |
| `help` | Help command to check the available commands/flags |

---
<Note>
Since `baseai` is installed locally in your project you can run all these commands using `npx baseai <command> [flag]` or `pnpm baseai <command> [flag]` or similary with other package manageers like `bun`, or `yarn`.
</Note>
---

### `help` command

`help` provides information about the available commands, flags and their usage.

```bash
npx baseai@latest help
```

---

### `dev` command

`dev` starts the local server of BaseAI in development mode. When working locally always have the local dev server running. It runs the server locally on `https://localhost:9000`. Your  `pipes`, `memory` and `tools` might also show logs in the console.

```bash
npx baseai@latest dev
```

---

### `pipe` command

`pipe` starts the process of creating a pipe in your application. Once a pipe is created, it will be available in the `pipes` folder of `baseai`.

```bash
npx baseai@latest pipe
```

---

### `memory` command

`memory` starts the process of creating a memory in your application. Once a memory is created, it will be available in the `memory` folder of `baseai`.

```bash
npx baseai@latest memory
```

---

### `tool` command

`tool` starts the process of creating a tool in your application. Once a tool is created, it will be available in the `tools` folder of `baseai`.

```bash
npx baseai@latest tool
```

---

### `add` command

`add` adds a pipe present on Langbase to your project. Once done, the pipe and its tools will become available in the `pipes` and `tools` folder of `baseai` respectively.

```bash
npx baseai@latest add <owner-login/pipe-name>
```

OR

```bash
npx baseai@latest add <link-to-pipe>
```

OR here's a practical example to download and add this [AI Title Generator pipe](https://langbase.com/langbase/ai-title-generator) to your project.

```bash
npx baseai@latest add langbase/ai-title-generator
```

---

### `auth` command

`auth` starts the authentication process of BaseAI with Langbase. Once done, you will be able to deploy `pipes`, `memory` and `tools` of your application to Langbase.

```bash
npx baseai@latest auth
```

---

### `build` command

`build` builds `pipes`, `memory` and `tools` of your application with BaseAI. These build files are then used during the deployment to Langbase.

```bash
npx baseai@latest build
```

---

### `deploy` command

`deploy` deploys `pipes`, `memory` and `tools` of your application to Langbase.

```bash
npx baseai@latest deploy
```

---
